﻿CREATE TABLE [dbo].[WikiEntry](
	WikiEntryID int NOT NULL IDENTITY (1, 1),
	InstanceID nvarchar(50) NOT NULL,
	PageID nvarchar(100) COLLATE Latin1_General_CI_AS NOT NULL,
	Version int NOT NULL,
	AuthorName nvarchar(256) COLLATE Latin1_General_CI_AS NOT NULL,
	Text nvarchar(MAX) COLLATE Latin1_General_CI_AS NOT NULL,
	TimeCreated smalldatetime NOT NULL
 CONSTRAINT [PK_WikiEntryID] PRIMARY KEY CLUSTERED 
(
	[WikiEntryID] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO 

CREATE UNIQUE NONCLUSTERED INDEX IX_WikiEntry ON dbo.WikiEntry
	(
	InstanceID,
	PageID,
	Version
	) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO